package com.azdebugit.map.test;

class Myclass implements Comparable {
    public int x;

    public String name;

    public Myclass(int x, String name) {
        this.x = x;
        this.name = name;

    }

    public int compareTo(Myclass tmp) {
        if (this.x == tmp.x) {
            return this.name.compareTo(tmp.name);
        } else {
            return this.x - tmp.x;
        }
    }

    @Override
    public int compareTo(Object o) {
        Myclass tmp = (Myclass) o;
        return compareTo(tmp);
    }

    @Override
    public String toString() {
        return x + " " + name;
    }


 /*   @Override
    public int compareTo(Object o) {
        return 0;
    }*/

    public int getX() {
        return x;
    }

    public String getName() {
        return name;
    }
}